# This program checks whether a source file (C++ syntax) has a license included
# in it. Returns 0 if the license is found, 1 if not. It also prints the
# license to STDOUT.

BEGIN {
    license_begun = 0
}

/[ ]*\/\*!license/ { license_begun = 1; }

// {
    if (license_begun == 1)
        print
}

/[ ]*\*\// { if (license_begun == 1) exit 0 }

END {
    if (license_begun == 0)
        exit 1
}
